
pkgname=mkinitcpio-busybox
pkgver=1.28.3
pkgrel=1
pkgdesc="Base initramfs tools"
arch=('x86_64')
url="https://www.busybox.net/"
license=('GPL')
depends=('glibc')
options=('!buildflags')
source=("https://busybox.net/downloads/busybox-${pkgver}.tar.bz2"
        'config')
md5sums=('82e5ad09ae4a07c266fc179492b51757'
         'cef00df90d303c9a1f4b423852ebffc0')

build() {
  cd busybox-${pkgver}

  local safeflags="${CARCH/_/-} -mtune=generic -Os -pipe -fno-strict-aliasing"
  sed 's|^\(CONFIG_EXTRA_CFLAGS\)=.*|\1="-march='"$safeflags"'"|' ${srcdir}/config > .config

  make
}

package() {
  install -Dm755 ${srcdir}/busybox-${pkgver}/busybox ${pkgdir}/usr/lib/initcpio/busybox
}

